import { Meta, ArgsTable, Canvas, Story, Markdown } from '@storybook/addon-docs';
import { FileUpload } from '@zendeskgarden/react-forms';
import { FileUploadStory } from './stories/FileUploadStory';
import { commonArgs, commonArgTypes, fieldSubcomponents } from './stories/common';
import README from '../README.md';

<Meta
  title="Packages/Forms/FileUpload"
  component={FileUpload}
  subcomponents={{ ...fieldSubcomponents }}
/>

# API

<ArgsTable />

# Demo

<Canvas>
  <Story
    name="FileUpload"
    args={{
      children: 'Drag files here or click to upload',
      ...commonArgs
    }}
    argTypes={{
      tabIndex: { control: 'number' },
      ...commonArgTypes
    }}
    parameters={{
      design: {
        allowFullscreen: true,
        type: 'figma',
        url: 'https://www.figma.com/file/6g87L4FdKZTA3knt3Rsfdx/Garden?node-id=103%3A20268'
      }
    }}
  >
    {args => <FileUploadStory {...args} />}
  </Story>
</Canvas>

<Markdown>{README}</Markdown>
